From: Florian Müllner Date: Fri, 12 Mar 2021 22:25:12 +0000 (+0100) Subject: st/texture-cache: Fail loading invalid StImageContent X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~110 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=565255068874e004a5c0b8b98396591ec89a91d2;p=gnome-shell.git st/texture-cache: Fail loading invalid StImageContent Creating a content object from a cairo surface may fail, in which case we return an empty content with a 0x0 preferred size. However when we treat such a content object as GIcon, we happily load it anyway. Don't do that, so consumers like StIcon can fall back properly to an alternative. Part-of: --- diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index 178acbb5d..f235ace6e 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -982,6 +982,15 @@ st_texture_cache_load_gicon (StTextureCache *cache, if (ST_IS_IMAGE_CONTENT (icon)) { + int width, height; + + g_object_get (G_OBJECT (icon), + "preferred-width", &width, + "preferred-height", &height, + NULL); + if (width == 0 && height == 0) + return NULL; + return g_object_new (CLUTTER_TYPE_ACTOR, "content-gravity", CLUTTER_CONTENT_GRAVITY_RESIZE_ASPECT, "width", actor_size,